package com.erdos.upc.entity;

import java.util.List;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

import com.erdos.common.entity.AbstractEntity;



public class Group extends AbstractEntity {
	private String name;

	private String description;
	/**
	 * 角色列表
	 */
	private List<Role> roles;
	/**
	 *用户列表
	 */
	private List<User> users;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public List<Role> getRoles() {
		return roles;
	}

	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}

	public List<User> getUsers() {
		return users;
	}

	public void setUsers(List<User> users) {
		this.users = users;
	}

	/**
	 * equals方法复写
	 */
	public boolean equals(Object o) {
		if (!(o instanceof Group)) {
			return false;
		}
		Group group = (Group) o;
		return new EqualsBuilder().append(name, group.name).isEquals();
	}

	/**
	 * hashCode方法复写
	 */
	public int hashCode() {
		return new HashCodeBuilder(61, 15).append(name).toHashCode();
	}

}